def sort(data):
    for i in range(len(data)-1):
        for j in range(len(data)-i-1):
            if data[j] < data[j+1]:
                data[j],data[j+1] = data[j+1],data[j]




lst=[]
for i in range(10):
    lst.append(int(input()))

sort(lst)
print(sum(lst[0:5]))
